package org.orz.story.pms.common.exception;

import org.orz.cloud.common.exception.BusinessException;
import org.orz.cloud.common.exception.ErrorCode;

public class PmsException extends BusinessException {

    public PmsException(ErrorCode code) {
        super(code);
    }
    public PmsException(String errorCode,String errorMessage){
        super(errorCode, errorMessage);
    }

    public enum Type implements ErrorCode{
        PMS_0001("PMS_0001", "未登录"),
        PMS_0002("PMS_0002", "没有权限"),
        PMS_0003("PMS_0003", "接口已经存在"),
        PMS_0004("PMS_0004", "权限账号不存在"),
        PMS_0005("PMS_0005", "工作台不存在"),
        PMS_0006("PMS_0006", "工作台不能为空"),
        PMS_0007("PMS_0007", "角色已经存在"),
        PMS_0008("PMS_0008", "父级权限不存在"),
        PMS_0009("PMS_0009", "权限不存在"),
        PMS_0010("PMS_0010", "当前节点有子节点，不能删除"),

        ;
        private String code;

        private String message;

        Type(String code, String message) {
            this.code = code;
            this.message = message;
        }

        public String getCode() {
            return code;
        }

        public String getMessage() {
            return message;
        }
    }

}
